<?php
/**
 * 收货地址
 * @author lzy <1029460965@qq.com>
 */
namespace app\common\model;

class Address extends Base
{
    /**
     * 获取用户地址列表
     * @param array $where 条件
     * @return mixed
     */
    public function getAddress($where=[],$filed='*'){
        $result = self::alias('a')
            ->field($filed)
            ->where($where)
            ->join([
                ['china c1','c1.id=a.pid','left'],
                ['china c2','c2.id=a.cid','left'],
                ['china c3','c3.id=a.aid','left'],
            ])
            ->order('a.id desc')
            ->select();
        if ($result){
            $result = endoceArr($result);
        }
        return $result;
    }



}